import request from '@/utils/request'

const baseUrl = '/api/salary'
// 获取薪资列表
export function getSalaryList(params) {
    return request({
        url: `${baseUrl}/list`,
        method: 'get',
        params
    })
}

// 获取薪资详情
export function getSalaryDetail(id) {
    return request({
        url: `${baseUrl}/view/${id}`,
        method: 'get'
    })
}

// 创建薪资记录
export function createSalary(data) {
    return request({
        url: `${baseUrl}/save`,
        method: 'post',
        data
    })
}

// 更新薪资记录
export function updateSalary(id, data) {
    return request({
        url: `${baseUrl}/save`,
        method: 'post',
        data
    })
}

// 删除薪资记录
export function deleteSalary(id) {
    return request({
        url: `${baseUrl}/delete/${id}`,
        method: 'delete'
    })
} 